package com.spark.lola.logistics.mapper;

import com.spark.lola.logistics.entity.ExpensesProcess;
import com.spark.lola.support.mybatis.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: Zhi-peng wang
 * @date: 2020/05/28 10:34
 **/
@Mapper
public interface ExpensesProcessMapper extends BaseMapper<ExpensesProcess> {

    @Select("select * from logistics_expenses_process where order_id=#{expensesId}")
    List<ExpensesProcess> findByExpensesId(long expensesId);

    @Delete("delete from logistics_expenses_process where order_id=#{expensesId}")
    int deleteByExpensesId(long expensesId);

    @Select("select * from logistics_expenses_process where order_id=#{expensesId} and action_code=#{actionCode} and flag=#{flag}")
    List<ExpensesProcess> findNewest(long expensesId, int actionCode, int flag);

}
